Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
idb-connector
Advanced tools
The Node.js iDB Connector is an IBM i Node.js Db2 driver open source project from IBM
npm i idb-connector
NOTE This package only installs on IBM i systems.
Then you can require in your code, as shown below.
const db = require('idb-connector');
const {dbconn, dbstmt} = require('idb-connector');
const sSql = 'SELECT STATE FROM QIWS.QCUSTCDT';
const connection = new dbconn();
connection.conn('*LOCAL');
const statement = new dbstmt(connection);
statement.exec(sSql, (x) => {
console.log(JSON.stringify(x));
statement.close();
connection.disconn();
connection.close();
});
const {dbconn, dbstmt} = require('idb-connector');
const sSql = 'SELECT STATE FROM QIWS.QCUSTCDT';
const connection = new dbconn();
connection.conn('*LOCAL');
const statement = new dbstmt(connection);
statement.prepare(sSql, () => {
statement.execute(() => {
statement.fetchAll((x) => {
console.log(`Result is : ${JSON.stringify(x)}`);
statement.close();
});
});
});
const {dbconn, dbstmt} = require('idb-connector');
const sql = 'CALL QXMLSERV.iPLUG512K(?,?,?,?)';
const connection = new dbconn();
connection.conn('*LOCAL');
const statement = new dbstmt(connection);
const ipc = '*NA';
const ctl = '*here';
const xmlIn = `<xmlservice><sh>system 'wrksbs'</sh></xmlservice>`;
const xmlOut = '';
statement.prepare(sql, () => {
statement.bindParameters([ipc, ctl, xmlIn, xmlOut], () => {
statement.execute((out) => {
for (let i = 0; i < out.length; i += 1) {
console.log(out[i]);
}
statement.close();
connection.disconn();
connection.close();
});
});
});
View CHANGELOG.md
file.
Note that building isn't necessary for end-users and is more for developers looking to compile the native Node.js extensions (C code).
git clone git@github.com:IBM/nodejs-idb-connector.git
cd nodejs-idb-connector
npm install --build-from-source
Note: sqlcli header files, GCC, and Python are required to compile the code.
yum install sqlcli-devel
yum group install 'Development tools'
yum install python2
Please read the contribution guidelines.
FAQs
A Node.js DB2 driver for IBM i
The npm package idb-connector receives a total of 147 weekly downloads. As such, idb-connector popularity was classified as not popular.
We found that idb-connector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.